﻿using System;
using System.Reflection;
using System.Collections.Generic;

namespace UFrameWork
{
    /// <summary>
    /// 框架事件通知定义
    /// </summary>
    public class UEvent
    {
        /// <summary>
        /// 框架加载完成
        /// ()
        /// </summary>
        public const string INIT_FINISH = "uwork.init.finish";

        /// <summary>
        /// 服务器退出
        /// () return bool
        /// </summary>
        public const string SERVER_QUIT = "uwork.server.quit";

        /// <summary>
        /// 执行命令
        /// (UMethod method, object[] params)
        /// </summary>
        public const string CMD_DO_START = "uwork.cmd.do.start";

        /// <summary>
        /// 执行命令出错
        /// (MethodInfo method, object[] params,Exception e)
        /// </summary>
        public const string CMD_DO_ERROR = "uwork.cmd.do.error";

        /// <summary>
        /// 执行命令结束
        /// (UMethod method, object[] params,object return)
        /// </summary>
        public const string CMD_DO_END = "uwork.cmd.do.end";

        /// <summary>
        /// 消息分发
        /// (USession session,string msg)
        /// </summary>
        public const string SERVER_MSG_DISPATCH = "uwork.server.msg.dispatch";

        /// <summary>
        /// 消息分发错误
        /// (UClient session,string msg,Exception e)
        /// </summary>
        public const string SERVER_MSG_DISPATCH_ERROR = "uwork.server.msg.dispatch.error";

        /// <summary>
        /// 服务器启动成功
        /// (Userver server)
        /// </summary>
        public const string SERVER_START_SUCCESS = "uwork.server.start.success";

        /// <summary>
        /// 服务器启动失败
        /// (Userver server,string msg)
        /// </summary>
        public const string SERVER_START_FAIL = "uwork.server.start.fail";

        /// <summary>
        /// 新会话连接
        /// (USession session)
        /// </summary>
        public const string SERVER_SESSION_NEW = "uwork.server.session.new";

        /// <summary>
        /// 会话断开连接
        /// (USession session, CloseReason reason)
        /// </summary>
        public const string SERVER_SESSION_CLOSE = "uwork.server.session.close";

        /// <summary>
        /// 服务器发送消息
        /// (USession session,string msg)
        /// </summary>
        public const string SERVER_SEND_MSG = "uwork.server.send.msg";

        /// <summary>
        /// 网络客户端连接成功
        /// (UClient client)
        /// </summary>
        public const string CLIENT_CONNECT_SUCCESS = "uwork.client.connect.success";

        /// <summary>
        /// 网络客户端接受的网络数据
        /// (UClient client,string msg)
        /// </summary>
        public const string CLIENT_RECEIVE_DATA = "uwork.client.receive.data";

        /// <summary>
        /// 网络客户端接受的网络消息
        /// (UClient client,string msg)
        /// </summary>
        public const string CLIENT_RECEIVE_MSG = "uwork.client.receive.msg";

        /// <summary>
        /// 网络客户端发送网络消息
        /// (UClient client,string msg)
        /// </summary>
        public const string CLIENT_SEND_MSG = "uwork.client.send.msg";

        /// <summary>
        /// 网络客户端消息分发
        /// (UClient session,string msg)
        /// </summary>
        public const string CLIENT_MSG_DISPATCH = "uwork.client.msg.dispatch";

        /// <summary>
        /// 网络客户端消息分发错误
        /// (UClient session,string msg,Exception e)
        /// </summary>
        public const string CLIENT_MSG_DISPATCH_ERROR = "uwork.client.msg.dispatch.error";

        /// <summary>
        /// 网络客户端连接断开
        /// (UClient client,Exception e)
        /// </summary>
        public const string CLIENT_CONNECT_CLOSE = "uwork.client.connect.close";
    }
}